I get this warning for certain view hierarchies. The following code triggers the warning, but if I move the Button out of the Form or change Form to be a VStack, the warning disappears. It seems like a bug to me, and I have filed a bug report.
struct ContentView: View {
@StateObject var viewModel = ViewModel()
var body: some View {
Form {
Button("Save") {
viewModel.counter += 1
}
}
}
}
class ViewModel: ObservableObject {
@Published var counter = 0
}